package com.huluobo.a2207douyindemo.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.huluobo.a2207douyindemo.R;
import com.huluobo.a2207douyindemo.utils.ImageUtils;
import com.huluobo.base.bean.CommentBeanResult;

/**
 * Created by LC on 2024/9/19.
 */
public class CommentAdapter extends BaseQuickAdapter<CommentBeanResult.CommentBean, BaseViewHolder> {
    public CommentAdapter() {
        super(R.layout.item_comment);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, CommentBeanResult.CommentBean commentBean) {
        ImageUtils.getInstance().loadImage(getContext(), commentBean.getIcon(),
                baseViewHolder.getView(R.id.item_comment_icon_iv));
        baseViewHolder.setText(R.id.item_comment_name_tv, commentBean.getUsername());
        baseViewHolder.setText(R.id.item_comment_msg_tv, commentBean.getMsg());
        baseViewHolder.setText(R.id.item_comment_time_tv, commentBean.getCreatetime());
    }
}
